#!/usr/bin/env python

import rospy
from std_msgs.msg import String, Float64

def string_callback(msg):
    # Extract the string data from the message
    received_string = msg.data
    rospy.loginfo("Received string message: %s", received_string)

def float_callback(msg):
    rospy.loginfo("Received float message: %f", msg.data)

def listener():
    rospy.init_node('listener', anonymous=True)
    rospy.Subscriber("chatter", String, string_callback)  # Subscribe to string messages
    rospy.Subscriber("float_topic", Float64, float_callback)
    rospy.spin()

if __name__ == '__main__':
    listener()

